<template>
	<view class="brand-item">
		<view class="diy-activity-product-list">
			<view class="activity-product-item" @click="goDetail(item.card_id)">
				<view class="activity-product-cover">
					<image :src="item.file.file_path" style="width: 100%;height: 384rpx;" mode="scaleToFill"></image>
					<view class="activity-product-info">
						<view class="assemble-title text-ellipsis-1">
							<view class="title linedot">{{ item.card_name }}</view>
							<view class="line-price">￥<text class="text-price">{{ item.retail_price }}</text></view>
						</view>
						<view class="valid-period">
							{{ item.valid_period.text }}
						</view>
						<view class="buy">
							立即购买
						</view>
					</view>
				</view>
				<view>
					<scroll-view scroll-x="true" style="white-space: nowrap">
					    <block v-for="(it, index) in item.Relevance" :key="index">
					        <view style="width: 35%;display: inline-block;;margin: 20rpx">
					            <view class="benefit-items">
					                <image :src="it.benefit.file.file_path" mode="aspectFill"></image>
					                <view class="benefit-title">
										<view class="name text-ellipsis-1">
											{{ it.benefit.benefit_name }}
											<text class="times">{{ it.number }}次</text>
										</view>
										<view class="des text-ellipsis-1">{{ it.benefit.remarks }}</view>
									</view>
					            </view>
					        </view>
					    </block>
					</scroll-view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			item: {
				type: Object,
				default() {
					return {}
				}
			},
		},
		data() {
			return {
				temp: {},
				timer: null,
				seconds: 0,
				btnText: '',
				btnType: 0,
			}
		},
		created() {
			let _self = this
			console.log(11111)
			console.log(_self.item)
			_self.temp = _self.item
		},
		methods: {
			goDetail(id) {
				uni.navigateTo({
					url: '/pagesBenefit/benefit/detail?card_id='+id
				})
			},
			goGood(id) {
				uni.navigateTo({
					url: '/pagesBenefit/benefit/detail?log_id='+id
				})
			},
		}
	}
</script>

<style lang="scss">
	page {
		// background: #F0F0F0;
	}
	.brand-item {
		border-radius: 20rpx;
		background: #ffffff;
	}
	
	/* 大图样式 */
	.diy-activity-product-list {
		.activity-product-item {
			background-color: white;
			border-radius: 20rpx;
			height: 416rpx;
			margin-bottom: 30rpx;
			overflow: hidden;
			
			.activity-product-cover {
				height: 280rpx;
				overflow: hidden;
				position: relative;
			}
			
			.activity-product-info {
				color: #ffffff;
				position: absolute;
				top: 0;
				height: 188rpx;
				padding: 48rpx 60rpx 48rpx 48rpx;
				width: 100%;
				
				.assemble-title {
					display: flex;
					justify-content: space-between;
					align-items: flex-end;
					
					.title {
						font-family: PingFang SC;
						font-size: 40rpx;
						line-height: 36rpx;
						font-weight: 600;
						width: 60%;
					}
					
					.line-price {
						flex-shrink: 0;
						font-family: PingFang SC;
						font-size: 24rpx;
						line-height: 36rpx;
						font-weight: 600;
						.text-price {
							font-size: 40rpx;
						}
					}
				}
				.valid-period {
					font-size: 24rpx;
					margin-top: 16rpx;
				}
				.buy {
					width: 192rpx;
					height: 80rpx;
					border: 1rpx solid #ffffff;
					line-height: 80rpx;
					text-align: center;
					border-radius: 40rpx;
					right: 48rpx;
					position: absolute;
				}
			}
			.benefit-items {
				position: relative;
				display: flex;
				align-items: center;
				image {
					margin-right: 16rpx;
					width: 60rpx;
					height: 60rpx;
					border-radius: 50%
				}
				.benefit-title {
					width: 60%;
				}
				.name {
					font-size: 24rpx;
					color: #1B1B1B;
					font-weight: 500;
				}
				.times {
					font-weight: 600;
					margin-left: 16rpx;
				}
				.des {
					color: #999999;
					font-size: 24rpx;
				}
			}
		}
	}
</style>
